Vue.component("show", {
  props: ["role"],
  template: `
        <ul>
            <li v-for = "item in role" :key="item.role_id">
            <p>{{item.roleName}}</p>
            <img :src="item.roleThumbnail" alt="">
            </li>
            </ul> `,
});
//在vue中使用axios
const app = new Vue({
    el: "#app",
    data:{
        roles:[]
    },
    created(){
        //this指向更改
        var that = this;
        axios({
          method: "get",
          url: "http://api.aulence.com/mydata/roles/role-info.php?goodsID=12", //请求地址
        }).then(function(res) {
          //数据赋值
          that.roles = res.data;
          console.log(res)
        })
    }
})